public class Bank {

   public double  balance;
    public double  qukuan;
    public Bank(double balance,double qukuan) {
        this.balance = balance;
        this.qukuan = qukuan;
    }
    public void  deposite(){
        System.out.println("存款金额为:"+balance);
    }
    public void  withdraw() {
        System.out.println("取款金额为:"+qukuan);
    }
    public class MYException extends Exception{
        public MYException(String str){
            super(str);
        }
    }
    public void getbalance()throws MYException{
        if (qukuan>balance)
            throw new MYException("账户余额不足");
    }

    public static void main(String[] args) {
        Bank bank = new Bank(3000,7777);
        bank.deposite();
        bank.withdraw();
        try {
            bank.getbalance();
        }catch (MYException e){
            e.printStackTrace();
        }

    }

}

